#ifndef _COMMON_H__
#define _COMMON_H__


#define ECHO_TEST_TXD 12
#define ECHO_TEST_RXD 14
#define ECHO_TEST_RTS (UART_PIN_NO_CHANGE)
#define ECHO_TEST_CTS (UART_PIN_NO_CHANGE)

#define ECHO_UART_PORT_NUM      2
#define ECHO_UART_BAUD_RATE     9600
#define ECHO_TASK_STACK_SIZE    4096

#define HUMAN_MODE 0
#define OBJECT_MODE 1

#define RUNNING 200
#define CONN_DISCONNECTED_EXCEPTION 1
#define TRANSMIT_EXCEPTION 3
#define NULL_EXCEPTION 4
#define VALIDATE_500_EXCEPTION 5
#define SENSOR_EXCEPTIION 500 // == STOP_FLAG

#define GLOBAL_EXCEPTION -404
#define REBOOT_EXCEPTION -500
#define STOP_FLAG SENSOR_EXCEPTIION

#define HB_INTERVAL 100 // 心跳周期（ms）一般是100ms 必须整数
#define MEASURE_INTERVAL 3 // 10倍心跳周期为单位时间 必须整数
#define UPDATE_INTERVAL 5 // MEASURE_INTERVAL*10倍心跳周期为单位时间 必须整数

#define VARIATE_COEFFICIENT 5.1 //延时误差系数

#define RECV_BUF_SIZE (1024)
#define SEND_BUF_SIZE (5)

#define EX_UART_NUM UART_NUM_0
#define PATTERN_CHR_NUM (3)    



void main(void);

int get_temprature(void);

int isElementInArray(int arr[], int size, int element);

void turn_led(int stat);

void configure_led(void);

#endif
